﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace LogManager.Base
{
    public interface IEvent
    {
        /// <summary>
        /// User of the event
        /// </summary>
        [DisplayName("User")]
        string User { get; set; }

        /// <summary>
        /// Level of the event
        /// </summary>
        [DisplayName("Level")]
        string Level { get; set; }

        /// <summary>
        /// Contains all property data of the event.
        /// Except the properties defined in this interface, all properties should get and set the value in this dictionary
        /// </summary>
        IDictionary<string, string> Properties { get; set; }
        
        /// <summary>
        /// Contains all properties that have no name defined
        /// </summary>
        IEnumerable<string> UndefinedProperties { get; set;}

        /// <summary>
        /// Name of the log
        /// </summary>
        [Display(Name = "Log")]
        string LogName { get; set; }

        /// <summary>
        /// Name of the server
        /// </summary>
        [Display(Name = "Server")]
        string ServerName { get; set; }

        /// <summary>
        /// Gets the identifier for this event. Has to be unique foreach event in a log.
        /// </summary>
        string Id { get; set; }

        /// <summary>
        /// The type of the event (is unique)
        /// </summary>
        string Type { get; set; }

        /// <summary>
        /// A message that describes the event more detailed
        /// </summary>
        string Message { get; set; }

        /// <summary>
        /// Datetime when the event was created
        /// </summary>
        DateTime TimeStamp { get; set; }

        void Initialize(string serverName, string logName);
    }    
}